package cn.wolfcode.mapper;

import cn.wolfcode.domain.User;

import java.util.HashMap;
import java.util.Map;

public class DataMapper {
    private static Map<String, User> userData = new HashMap<String,User>();

    /*static {
        // 初始化数据
        User u1 = new User("lanxw", "666");
        User u2 = new User("yl","888");
        userData.put(u1.getUsername(),u1);
        userData.put(u2.getUsername(),u2);
    }*/

    // 提供静态方法，模拟数据库返回数据
    public static User getUserByName(String Username){
        return userData.get(Username);
    }
}
